package com.modifiertech.lineage.skills;

import com.feed_the_beast.ftblib.lib.icon.Icon;
import com.modifiertech.lineage.BaseConst;
import com.modifiertech.lineage.Lineage;
import com.modifiertech.lineage.api.PlayerData;
import com.modifiertech.lineage.api.PlayerDataSkill;
import com.modifiertech.lineage.client.gui.ftbint.GuiIconsV2;
import com.modifiertech.lineage.event.PlayerDataHandler;
import com.modifiertech.lineage.event.SkillLevelUpEvent;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.event.entity.living.LivingHurtEvent;

import java.util.ArrayList;
import java.util.List;

public class ShooterDiscipline extends PlayerDataSkill {
    @Override
    protected Icon defineSkillIcon() {
        return GuiIconsV2.ShooterDiscipline;
    }

    @Override
    protected String defineSkillType() {
        return BaseConst.PLAYER_ADV_TAG__SKILLS_SPE;
    }

    @Override
    protected String defineSkillSecondType() {
        return BaseConst.PLAYER_ADV_SEC_TAG__SKILLS_STATE;
    }

    @Override
    protected String defineSkillName() {
        return "射手素养";
    }

    @Override
    protected int defineSkillLevelDependency() {
        return 101;
    }

    @Override
    public String defineSkillDesc() {
        int skillLevel = getSkillLevel();
        return "训练有素是战争获胜的可靠保障,每一级可以增加 2 点 额外子弹伤害."+
                (skillLevel>0?"\n效果:当前提供 §6§l"+skillLevel*2+" 额外子弹伤害.":"") ;
    }

    @Override
    protected double defineSkillRowX() {
        return 1;
    }

    @Override
    protected double defineSkillColumnY() {
        return 1;
    }

    @Override
    protected int defineSkillCoolDown() {
        return -1;
    }

    @Override
    protected double defineSkillManaUse() {
        return 0;
    }

    @Override
    protected List<String> defineSkillDependencyName() {
        return new ArrayList<>();
    }

    @Override
    protected int defineSkillRegion() {
        return 0;
    }

    @Override
    protected int defineUpgradePoint() {
        return 25;
    }

    @Override
    public void onAttackMob(LivingHurtEvent event) {
//        ConfigHandler 可转换为配置参数
        if (event.getSource().getImmediateSource().getName().equals("entity.Ammo256.name")){
            event.setAmount(event.getAmount()+getSkillLevel()*2);
        }
    }
}
